﻿using System.Linq;
using NAGFwk.BL;
using SilkeyERP.Model;

namespace SilkeyERP.BL
{
    public partial class CustomerController : IBaseController<Customer>
    {
        public int GetLastCustomerCode()
        {
            return this.Repository.GetAll().OrderBy(x=>x.CustomerCode).Last().CustomerCode;
        }

        public int GetNextCustomerCode()
        {
            return this.Repository.GetAll().OrderBy(x => x.CustomerCode).Last().CustomerCode + 1;
        }
    }
}
